<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>vue鼠标事件</title>
    <style type="text/css">
        #div-1 {
            width: 300px;
            height: 300px;
            background-color: #f7e1b5;
        }

        #div-2 {
            width: 200px;
            height: 200px;
            background-color: #df3a00;
        }

        #div-3 {
            width: 100px;
            height: 100px;
            background-color: #5bc0de;
            color: red;
        }
    </style>
    <script src="../js/vue.js"></script>
</head>
<body>
<div id="vue-3—top">
    <div id="div-1" @click="click1()">
        <div id="div-2" @click="click2()">
            <div id="div-3" @click.stop="click3($event)">点我</div>
        </div>
    </div>
</div>
</body>
<script type="text/javascript">
    let vm = new Vue({
        el: '#vue-3—top',
        data: {},
        methods: {
            click1() {
                alert('一被点击了');
                console.log('一被点击了');
            },
            click2() {
                alert('二被点击了');
            },
            click3(e) {
                alert('三被点击了');
                console.log(e);
                console.log(e.type);
                console.log(e.target);
            }
        }
    });
</script>
</html>